package com.dys.controller;

import com.dys.common.ResponseResult;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 疾风
 * @ClassName: MenuController
 * @Description: 菜单控制器
 * @CreateDate: 2024/12/17
 * @Version: v1.0.0
 */
@RestController
@RequestMapping(value = {"/menu"})
public class MenuController {

    @GetMapping(value = {"/hello", "/test"})
    @PreAuthorize(value = "hasAuthority('system:user:list')")
    public ResponseResult<String> hello() {
        return new ResponseResult<>(200, "响应成功", "拥有system:user:list权限才能访问");
    }

    @GetMapping(value = {"/hasRoleList"})
    @PreAuthorize(value = "hasAuthority('system:role:list')")
    public ResponseResult<String> hasRoleList() {
        return new ResponseResult<>(200, "响应成功", "拥有system:role:list 才能访问");
    }
}
